package com.anytrek.cloudcommon.config;

import com.anytrek.cloudcommon.utils.ApiResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @ ClassName GlobalFallbackHandler
 * @ Author Alex2
 * @ Date 2025/8/27 17:46
 **/
@RestControllerAdvice
public class GlobalFallbackHandler {

    @ExceptionHandler(Exception.class)
    public ApiResult handleException(Exception ex) {
        return ApiResult.error("系统异常：" + ex.getMessage());
    }
}